using MoonFramework.View;

namespace MoonFramework.FSM
{
    public abstract class DeadState : BaseState
    {
        public override void Enter()
        {
            AnimancerManager.Instance.Play(_actor.viewController._DeadAnimation, 
                _actor.viewController.AnimancerComponent);
            _actor.viewController.AddAnimationEvent(nameof(DeadOver) ,DeadOver);
        }

        protected abstract void DeadOver();

        public override void Exit()
        {
            _actor.viewController.RemoveAnimationEvent(nameof(DeadOver) ,DeadOver);
        }
    }
}